<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%@  taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<head>
    <meta charset="utf-8">
    <title>问卷调查表</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/css/bootstrap.min.css">
    <script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/popper.js/1.15.0/umd/popper.min.js"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <style>
        .center {
            margin: auto;
            width: 60%;
            border: 1px solid #5B5B5B;
            padding: 10px;
        }
    </style>
</head>
<body>
<form action="/Question/form" method="get">
<c:forEach items="${questionnaires}" var="u">
<div  class="center">
    <label for="name">${u.question_name}</label>
    <div class="radio">
        <label>
            <input type="radio" name="q[${u.question_id}]" id="optionsRadios1" value="1" checked> 否
        </label>
    </div>
    <div class="radio">
        <label>
            <input type="radio" name="q[${u.question_id}]" id="optionsRadios2" value="2">是
        </label>
    </div>
</div>
</c:forEach>
<div style="text-align:center">
    <button type="submit" class="btn btn-default" style="width: 200px">提交</button>
</div>
</form>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
    <div class="modal-content">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                &times;
            </button>
        </div>
        <div class="modal-body">
            <input id="tips_title1" class="tips_title" name="tips_title" value="" readonly style="border:none;outline:medium;">
            <textarea id="tips_content1" class="tips_content"  name="tips_content" cols="60"   rows="8"    style="OVERFLOW:   hidden" readonly></textarea>
            <%--<input id="tips_date1" class="tips_date" name="tips_date" value="" style="border: none" readonly>发布--%>
        </div>
    </div><!-- /.modal-content -->
</div><!-- /.modal -->
</div>
<script type="text/javascript">

    // $(function(){
    //     $('#myModal').modal('show')
    // });
    $(function(){
        $('#myModal').modal('show')
        var data={
            "tips_id":1

        }
        $.ajax({
            url:"/tips/query1.do",
            type : "post",
            data: JSON.stringify(data),
            success:function (tips) {
                $("#tips_id1").val(tips.tips_id);
                $("#tips_title1").val(tips.tips_title);
                $("#tips_content1").val(tips.tips_content);
                $("#tips_open1").val(tips.tips_open);
                $("#tips_date1").val(tips.tips_date);
            },
            dataType: "json",
            contentType: "application/json"
        })
    });
</script>
</body>
</html>